//
//  UIView+RTLayout.m
//  WeiboSina
//
//  Created by Brisinga on 16/3/4.
//  Copyright © 2016年 Root. All rights reserved.
//

#import "UIView+RTLayout.h"

@implementation UIView (RTLayout)


- (void)setX:(CGFloat)x {

    CGRect frame = self.frame;
    
    frame.origin.x = x;
    
    self.frame = frame;
}

- (CGFloat)x {
    
    return self.frame.origin.x;
}


- (void)setY:(CGFloat)y {

    CGRect frame = self.frame;
    
    frame.origin.y = y;
    
    self.frame = frame;
}

- (CGFloat)y {

    return self.frame.origin.y;
}


- (void)setWidth:(CGFloat)width {
    
    CGRect frame = self.frame;
    
    frame.size.width = width;
    
    self.frame = frame;
}


- (CGFloat)width {

    return self.frame.size.width;
}


- (void)setHeight:(CGFloat)height {
    
    CGRect frame = self.frame;
    
    frame.size.height = height;
    
    self.frame = frame;

}


- (CGFloat)height {

    return self.frame.size.height;
}



-(void)setBorderWidth:(CGFloat)borderWidth {
    
    self.layer.borderWidth = borderWidth;
}

- (CGFloat)borderWidth {
    
    return self.layer.borderWidth;
}


- (void)setBorderColor:(UIColor *)borderColor {
    
    self.layer.borderColor = borderColor.CGColor;
}

- (UIColor *)borderColor {
    
    return [UIColor colorWithCGColor:self.layer.borderColor];
}


- (void)setCornerRadius:(CGFloat)cornerRadius {
    
    self.layer.cornerRadius = cornerRadius;
}


- (CGFloat)cornerRadius {
    
    return self.layer.cornerRadius;
}

@end
